Skip to content

Keep quota replan recovery inside control-plane boundaries - #9037

Closed
loopx-agent wants to merge 1 commit into
mainfrom
codex/c1-quota-readmodel-boundary-20261119
Closed

loopx-agent wants to merge 1 commit into
mainfrom
codex/c1-quota-readmodel-boundary-20261119

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When quota recovery removes a retired Goal instance's acknowledgement, the control plane calls back into the public status facade. The Todo read-model boundary smoke rejects that dependency before the rest of its checks can run.

Change

Use the existing control-plane replan projector for recovery. The quota command and its post-stall rebuild share the same decision builder with the established progress-review loader. Scheduler follow-up and Turn plan/launch callers that can resume a receipt-bound replan pass that same loader. Recovery keeps the original GoalRef, open obligation and assist-review evidence.

Validation

  • The unchanged Todo read-model smoke rejects the reverse import on main 453d4e3 and passes on this proposal in Python safe-path mode.
  • Three receipt-recovery CLI cases and 49 composed-settlement cases passed. A rebuilt and separately installed Core preserved and wrote back the original replan on File and SQLite and preserved the admitted assist review on File.
  • The local combination with Run the quota plan smoke in Python safe-path mode #9033 passed both premerge smokes. Changed-file Ruff, repository-configured mypy and the bilingual diff check passed.
  • The repository maintainability scan still reports the inherited size advisory in _admitted_interaction_next_cli_actions. Additional file-explicit mypy reported the same 11 existing diagnostics on the original paired base and candidate.

Final local validation

  • The final head passed 259 focused tests. The merge tree with main d95e81e passed both unchanged safe-path smokes and the three original-replan recovery cases. Run the quota plan smoke in Python safe-path mode #9033 is included in that main revision.
  • Standard premerge against the pinned d95e81e scope passed all 6 direct and 18 selected checks with the existing maintainability advisory.
  • The Dashboard budget check initially failed with a long isolated temporary root. Main and this head both measured 25,174 characters in the paired reproduction and 24,383 with a short isolated root. The 25,000-character limit stayed in effect.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

quota 恢复、scheduler 回读和 Turn 启动前必须复用原 GoalRef 的 replan 证据,过滤已退休实例的 ACK。主干在重新投影时从 control plane 反向调用公共 status,导致 Todo read-model smoke 失败。候选改走原控制面投影,入口注入原 assist loader。相同输入的四条重建路径保留同一 obligation,并通过原边界 smoke。本轮验证来源、恢复选择及投影契约。

改动思路 / Approach

过滤沿用既有 GoalRef 判定,replan projector 从控制面模块直取。quota 首次及重建复用同一个部分应用的 builder,scheduler 和 Turn 入口传入同一既有 loader。恢复原依赖方向,继续使用原 guard、runs、ACK、assist 证据和 settlement owner。用独立 File 和 SQLite 夹具对照主干与候选,沿原 should-run 回执和实际重建函数读回结论,并核对读操作前后回执日志。

具体改动 / Changes

精确 head a8337bffeb5d15d7e1b77887f378f49ebee861c5,diff base 453d4e349cb08b4dd3258c4bbaaed4b9a3b513c8,5 个文件 +27/-9。逐项复核 forward-read-model-boundary、original-ref-and-ack、retain-progress-review。验收约定

关键代码讲解

  • 只在已有开放 replan 回执时调用 ACK 过滤,控制面直接复用原 replan projector 和既有 assist loader。源码
  • 普通 quota 执行和 post-stall 重建传同一个 builder,保持 loader 一致。源码
  • 实际 scheduler、Turn plan 和启动前读取均从原 receipt 出发。两种结算绑定的对照保留外部进度评审触发,读操作保持原日志。源码
  • 真实 held heartbeat 重新投影使用原 Todo 和 replan 身份,复用原始回执。源码

对主干的风险 / Risks

主干在相同 safe-path 命令下失败,候选完整通过。四个原 CLI 负例与两组多入口 replan 对照通过。组合结算复验 65 项通过、10 项跳过。普通 quota 和 settled replay 的 70 项也通过。作者记录的主干维护性提示涉及本次未改动的函数。

语义与 CI 对齐

File 和 SQLite 原回执测试保留过滤、结论与后续写回。真实的调度和 Turn 决策入口保持当前 assist 触发,输入未接受跨 GoalRef 的退休 ACK。

我的整体评价 / Verdict

批准当前提交。依赖边界修复已经由原 smoke 建立,原 GoalRef 回执、活跃 assist 的 replan 证据及四条重建路径的连续性均已独立验证。

English verdict: APPROVE. The read-model boundary smoke passes at this exact head. Scoped File and SQLite receipt tests and four reconstructed caller decisions preserve the original active assist replan and reject retired ACKs.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@huangruiteng
huangruiteng force-pushed the codex/c1-quota-readmodel-boundary-20261119 branch from a8337bf to e5f7567 Compare November 19, 2026 06:44
@mergify

mergify Bot commented Nov 19, 2026

Copy link
Copy Markdown

This pull request has merge conflicts with main and cannot be merged
until they are resolved. Please rebase or merge the base branch, @loopx-agent.

Choose the remote for the base repository, not an out-of-date fork.
For a fork clone, first inspect git remote -v; upstream must point
to https://github.com/loopx-project/loopx.git. If it is absent, add it
with git remote add upstream https://github.com/loopx-project/loopx.git.
Then run:

git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEAD

For a same-repository clone whose origin points to
https://github.com/loopx-project/loopx.git, use origin instead of
upstream for fetch/rebase. If you prefer merging the base, use
git merge <base-remote>/main and push normally.

Keep the DCO Signed-off-by trailer on every commit when you rebase.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase Mergify: the pull request has merge conflicts with its base branch label Nov 19, 2026
@huangruiteng

Copy link
Copy Markdown
Collaborator

Superseded by #9046, now merged. #9046 applies the same control-plane boundary repair through the capability-owned progress-review reader and also covers monitor-poll recovery, so retaining #9037 would duplicate the fix with a less complete implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Mergify: the pull request has merge conflicts with its base branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants